﻿<div class="tabs-users">
    <ul>
        <li><a data-ng-class="{active : activeViewPath==='/weightMatricesUpload' || isActive('/weightMatricesUpload') }" href="#/weightMatricesUpload">ESG Weight Matrices</a></li>
    </ul>
</div>
<br />

<!-- default matrix section -->
<div style="display: table; width: 99%;">
    <div class="table-row-inp">
        <div class="inp-label">
            Available platform slots
        </div>
        <div class="inp-holder">
            <span>{{weightMatrices.totalSlots}} of 100 used slots</span>
        </div>
    </div>
    <div class="table-spacer" style="line-height: 23px;">&nbsp;</div>
</div>
<!-- //default matrix section -->

<!-- custom matrices section -->
<div style="display: table; width: 99%;">
    <div class="table-spacer">&nbsp;</div>
    <div class="table-row-inp">
        <div class="inp-label">
            Account Name
        </div>
        <select ng-change="weightMatrices.loadAccountCustomMatrices()" class="select-box" style="width: 96%;" ng-model="weightMatrices.accountId">
            <option value="{{opt.id}}" ng-repeat="opt in weightMatrices.accountsList">
                {{opt.name}} - {{opt.platformTier === 100000000 ? 'Tier 1' : opt.platformTier === 100000001 ? 'Tier 2': 'Tier 3'}}
            </option>
        </select>
    </div>
    <div class="table-spacer">&nbsp;</div>

    <div class="table-row-inp">
        <div class="inp-label">
        </div>
        <button class="btn-green" ng-click="weightMatrices.addCustomWeightMatrix();" ng-disabled="!weightMatrices.accountId">Add new custom matrix</button>
    </div>
    <div class="table-spacer">&nbsp;</div>

    <div class="table-row-inp" ng-show="weightMatrices.accountWeightMatrices.length > 0">
        <div class="inp-label">
            Custom Matrices
        </div>
        <div style="display: table; width: 780px; float: left; border:1px dotted black">
            <div class="table-row">
                <div class="table-head width_190">
                    Custom Matrix Name
                </div>
                <div class="table-head width_110">Marked for deletion on</div>
                <div class="table-head width_110" style="width:62px">Selected in active profile</div>
                <div class="table-head width_110">
                    <span ng-if="weightMatrices.selectedAccount.platformTier == 100000000">
                        {{weightMatrices.accountWeightMatrices.length}} of 5 used slots (Tier 1)
                    </span>
                    <span ng-if="weightMatrices.selectedAccount.platformTier == 100000001">
                        {{weightMatrices.accountWeightMatrices.length}} of 2 used slots (Tier 2)
                    </span>
                    <span ng-if="weightMatrices.accountScheduledWeightMatrices.length > 0"><br />{{weightMatrices.accountScheduledWeightMatrices.length}} new scheduled matrices</span>
                </div>
            </div>
            <div class="table-row" ng-repeat="item in weightMatrices.accountWeightMatrices">
                <div class="table-col">
                    <a href="#" ng-click="weightMatrices.editCustomWeightMatrix(item);" style="overflow:hidden; display:block; max-width: 170px; text-overflow: ellipsis; white-space: nowrap; font-weight: bold;" title="{{item.name}}">{{ item.name && item.name.length > 50 ? item.name.substring(0, 50) + '...' : item.name }}</a>
                </div>
                <div class="table-col">{{item.markedForDeletionOn | date: 'MMM d, y'}}</div>
                <div class="table-col">{{item.isSelectedInActiveProfile}}</div>
                <div class="table-col">
                    <a href="#" ng-click="weightMatrices.downloadCustomWeightMatrix(item);">Download</a> |
                    <a href="#" ng-click="weightMatrices.editCustomWeightMatrix(item);">Edit</a> |
                    <a href="#" ng-click="weightMatrices.deleteCustomWeightMatrix(item);">Delete</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- //custom matrices section -->

<div ng-show="weightMatrices.weightMatrixUploadErrors" class="inp-label">Weight Matrix Upload Errors Log</div><br />
<div ng-show="weightMatrices.weightMatrixUploadErrors" style="width: 970px; overflow:auto">
    <pre class="pre-error-view">{{weightMatrices.weightMatrixUploadErrors}}</pre>
</div>

<br /><br />
<div class="footer-wrap">
    <div class="footer">
        <ul class="footer-nav">
            <li><a href="">Policies</a></li>
            <li><a href="">Sitemap</a></li>
            <li><a href="">Item 3</a></li>
            <li><a href="">Item 4</a></li>
            <li><a href="">Team Sustainalytics</a></li>
        </ul>
        <div class="copyright">
            ©Sustainalytics. All Rights Reserved
        </div>
        <div class="clear">&nbsp;</div>
    </div>
</div>